// 设置html字体
$(window).resize(function () {
    var width = $(window).width();
    if (width > 320 && width < 750) {
        var font = 100 / 1000 * width;
        $('html').css('fontSize', font + 'px')
    }
})
$(window).resize();
//购物车点击跳转;
$('.shopcar').click(function(){
    location.href="../htm/car.html"
});
//搜索框的点击跳转
$('.button').eq(1).click(function(){
    console.log(11);
    location.href="../项目--百联/sousuo.html";
})
// 头部点击事件
var num = 0
$('.header-two .two-fa').eq(0).click(function (e) {
    e.preventDefault
    num++
    if (num % 2 == 0) {
        $(this).children(".fa-ellipsis-h").show()
        $(this).children(".fa-times").css({ opacity: '0' })
        $(this).siblings().removeClass("down-show")
    } else {
        $(this).children(".fa-ellipsis-h").hide()
        $(this).children(".fa-times").css({ opacity: '1' })
        $(this).siblings().addClass("down-show")
    }
})
// swiper
var mySwiper = new Swiper('.swiper-container', {
    loop: true, // 循环模式选项
    autoplay: true,
    autoplay: {
        delay: 3000,//1秒切换一次
    },
    // 如果需要分页器
    pagination: {
        el: '.swiper-pagination',
        // bulletClass:'bottom:1px'
    },
})
// active
var data = [
    {
        "url": "../images/001.jpg",
        "groupTitle": "百联卡恭喜发财卡500面值（实体卡）",
        "middle": "面值：500 | 500 | 500 | 500",
        "bottom": "../images/buycar.62b325b.png"
    },
    {
        "url": "../images/002.jpg",
        "groupTitle": "新经典卡100面值",
        "middle": "面值：100 | 200 | 300 | 500 | 1000",
        "bottom": "../images/buycar.62b325b.png"
    },
    {
        "url": "../images/003.jpg",
        "groupTitle": "感恩卡100面值",
        "middle": "面值：100 | 200 | 300 | 500 | 1000",
        "bottom": "../images/buycar.62b325b.png"
    },
    {
        "url": "../images/004.jpg",
        "groupTitle": "春节版200面值（实体卡）",
        "middle": "面值：200 | 300 | 500 | 1000",
        "bottom": "../images/buycar.62b325b.png"
    }]
for (var i = 0; i < data.length; i++) {
    $(` <div>
<div class="list-contain">
    <img src="${data[i].url}" alt="">
    <div>
        <div>${data[i].groupTitle}</div>
        <p>${data[i].middle}</p>
        <i><img src="${data[i].bottom}"></i>
    </div>
</div>
</div>`).appendTo(".active")
}

$('.box-left').on('click', '.button', function (e) {
    e.preventDefault();
    history.go(-1);
})